package com.woniu.outlet.dao;


import java.util.List;

import com.woniu.outlet.po.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface InventoryPoMapper {
    long countByExample(InventoryPoExample example);

    int deleteByExample(InventoryPoExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(InventoryPo record);

    int insertSelective(InventoryPo record);

    List<InventoryPo> selectByExample(InventoryPoExample example);

    InventoryPo selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") InventoryPo record, @Param("example") InventoryPoExample example);

    int updateByExample(@Param("record") InventoryPo record, @Param("example") InventoryPoExample example);

    int updateByPrimaryKeySelective(InventoryPo record);

    int updateByPrimaryKey(InventoryPo record);

    @Update("update ERP_inventory set num=num-#{applicationNum} where code=#{materialCode}")
    void materialOut(ApplicationDetail applicationDetail);

    @Update("update ERP_inventory set num=num+#{num} where code=#{partsCode}")
    void projectIn(WarehouseApplicationPo warehouseApplicationPo);

    @Update("update ERP_inventory set num=num+#{inoutNum} where code=#{code}")
    void finishPurchase(InventoryInoutPo inventoryInoutPo);

    @Update("update ERP_inventory set num=#{num} where id=#{id}")
    void projectOut(InventoryPo inventoryPo);
}